package reflect;

import reflect.annotations.AutoRunClass;

/**
 * 反射机制访问被特定注解标识的类;
 */
public class Demo10Reflect {
    public static void main(String[] args) throws Exception{
        Class cls = Class.forName("reflect.Person");
        /*
            isAnnotationPresent():判断该类是否被指定的注解标注;
            1.标注了: true;
            2.未标注: false;
         */
        boolean mark = cls.isAnnotationPresent(AutoRunClass.class);
        System.out.println(mark ? "被标注了" : "没有被标注");
    }
}
